<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Offline Google Code wiki syntax editor for testing changes to GoogleCodeWikiParser</title>
<!--<script src="http://www.gstatic.com/codesite/ph/12364374701854919368/js/dwiki_scripts_20081003.js"></script>
<script src="http://www.gstatic.com/codesite/ph/12364374701854919368/js/prettify/prettify.js"></script>
<script type="text/javascript">
 prettyPrint();
 </script>
 <script src="http://www.gstatic.com/codesite/ph/12364374701854919368/js/dit_scripts.js" type="text/javascript"></script>
 <script src="http://www.gstatic.com/codesite/ph/12364374701854919368/js/core_scripts.js" type="text/javascript"></script>
 <script src="http://code.google.com/js/codesite_product_dictionary_ph.pack.04102009.js" type="text/javascript"></script>-->

  <script src="http://code.jquery.com/jquery-1.5.2.min.js" type="text/javascript"></script>
  <script type="text/javascript" src="expanded_source/GoogleCodeWikiParser.js"></script>
  <link type="text/css" rel="stylesheet" href="GoCoWi-previewer.css" />
  <script type="text/javascript">
    var gcwp;
    jQuery(document).ready(function() {
      jQuery.noConflict();
      gcwp = new GoogleCodeWikiParser();
      updateView();
      jQuery('#textarea').keypress(function(event) {
        if (event.keyCode == 13) {
          //event.preventDefault();
          updateView();
        }
      });
    });

    function updateView() {
      var c = jQuery('#textarea').attr('value');
      try {
        c = gcwp.parse(c)
        jQuery('#wikicontent').html(c);
      }
			catch(e) {
        alert("Exception while parsing wiki code:\n"+e);
      }
    }
  </script>
  <!--<script src="http://code-opensocial.googleusercontent.com/gadgets/js/rpc.js?c=1&amp;container=code"></script>-->
  <script src="expanded_source/google-gadgets_utils.js"></script>
  <script src="expanded_source/shindig-rpc/wpm.transport.js"></script>
  <script src="expanded_source/shindig-rpc/fe.transport.js"></script>
  <script src="expanded_source/shindig-rpc/flash.transport.js"></script>
  <script src="expanded_source/shindig-rpc/ifpc.transport.js"></script>
  <script src="expanded_source/shindig-rpc/nix.transport.js"></script>
  <script src="expanded_source/shindig-rpc/rmr.transport.js"></script>
  <script src="expanded_source/shindig-rpc/rpc.js"></script>
  <script type="text/javascript">
gadgets.config.init({
    "rpc": {
        "commSwf": "//xpc.googleusercontent.com/gadgets",
        "parentRelayUrl": "/rpc_relay.html"
    }
});

    function resizeIframeHandler(opt_height) {
      var elem = document.getElementById(this.f);
      if (!elem) return;
      if (!opt_height) {
        elem.style.height = undefined;
      }
      else {
        opt_height = Math.max(10, opt_height);
        elem.style.height = opt_height + 'px';
      }
    }
    gadgets.rpc.register("resize_iframe", resizeIframeHandler);

    gadgets.rpc.register('set_title', function(title) {
    var elem = document.getElementById(this.f + '_title');
    if (elem) {
      elem.innerHTML = gadgets.util.escape(title);
    }
    });
  </script>
</head>

<body>
	<table class="layout">
		<tr>
			<td class="layout" style="border-bottom: 1px solid #999; padding: 2px;" colspan="2">
			  Copy/paste the wiki code in the textarea on the left, edit it, and
              click the button to update the preview on the right. It will also update each time
              you tap the ENTER key in the left-side editor.
		    <br />
		    <button onclick="updateView()">Update Preview</button>
		  </td>
		</tr>
		<tr>
			<td class="layout">
<textarea id="textarea" wrap="soft" rows="50" class="editor">
=[http://code.google.com/p/wikiwym Wikiwym] demonstration!=

  * *bold* _emphasized_ and *_bold emphasized ^SuperScript^!_*.
  * item 2 is ~~stricken~~
  * item 3 is *~~boldly stricken~~*
  * item 4 is _~~*stricken boldly with emphasis*~~_

|| *a* || *b* || *c*||
|| a2 || ~~b2~~ || c2||
|| *_a3_* || b3 || *~~c3~~*||

  # ~~item~~
  # _~~item~~_
  * item

Intentional errors:

  * *unterminated bold
  * unterminated _*italics*
  * unterminated ^sup
  * mis-terminated ,,sub,
  * unterminated ,,sub
  * [UnterminatedLink

(If those are NOT _all_ marked with errors, something is broken.)

*Happy Hacking!*

-- [http://wanderinghorse.net/home/stephan/ stephan beal]

[http://wanderinghorse.net/home/stephan/ http://wanderinghorse.net/home/stephan/stephan_beal_sylt_072006_small.jpg]
</textarea>
      </td>
		  <td id="wikicontent" class="layout"></td>
		</tr>
	</table>
</body>
</html>
